<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<script type="text/javascript"
	src="${webpath}/static/jquery/validate/jquery-validate.js"></script>
<script type="text/javascript">
	$(function() {
		$.validateSetup({
			eachField : function() {
			},
			filter : '*',
			eachValidField : function() {
				$(this).closest(".form-group").removeClass("has-error")
						.addClass("has-success");
			},
			eachInvalidField : function() {
				$(this).closest(".form-group").removeClass("has-success")
						.addClass("has-error");
			},
			valid : function() {
				//var args = arguments;
				// args[0] event
				// args[1] validate options
			},
			invalid : function() {
				var args = arguments;
				var e = args[0];
				var ct = e.currentTarget;
				for ( var i in ct) {
					if (ct[i]["aria-invalid"]) {
						$(ct[i]).focus();
						break;
					}
				}
			}
		});
	});
</script>